Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix service account creation error in gke nodepool module #923

Merged
merged 4 commits into from
Oct 27, 2022

Conversation

ludoo
Copy link
Collaborator

@ludoo ludoo commented Oct 27, 2022

This changes variables so that count does not depend on the SA email, avoiding this error when an external SA is created in the same root module

Error: Invalid count argument

  on ../../../../modules/gke-nodepool/main.tf line 61, in resource "google_service_account" "service_account":
  61:   count        = local.service_account_create ? 1 : 0

The "count" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the count depends on.

@ludoo ludoo requested review from juliocc and cgrotz October 27, 2022 13:48
@ludoo ludoo enabled auto-merge (squash) October 27, 2022 13:49
@ludoo ludoo merged commit e20de3b into master Oct 27, 2022
@ludoo ludoo deleted the ludo/fix-gke-nodepool-sa branch October 27, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants